//
//  CETestCaseStandardParameter.m
//  CELog_Example
//
//  Created by maoerduo on 2021/3/1.
//  Copyright © 2021 maoerduo. All rights reserved.
//

#import "CETestCaseStandardParameter.h"
#import <sys/utsname.h>

@interface CETestCaseStandardParameter()


@end

@implementation CETestCaseStandardParameter

@synthesize appVersion;
@synthesize channel;
@synthesize deviceName;
@synthesize deviceUUID;
@synthesize firstOpenTimestamp;
@synthesize region;
@synthesize systemModel;
@synthesize systemVersion;

- (NSString *)deviceUUID {
    
    if (self.getDeviceUUID) {
        return self.getDeviceUUID();
    }else {
        return nil;
    }
        
}


- (NSString *)channel {
    
    if (self.getChannel) {
        return self.getChannel();
    }else {
        return nil;
    }
    
}


- (NSTimeInterval)firstOpenTimestamp {
    
    if (self.getFirstOpenTimestamp) {
        return self.getFirstOpenTimestamp();
    }else {
        return 0;
    }
    
}

- (NSString *)systemModel {
        
    struct utsname systemInfo;
    uname(&systemInfo);
    NSString *deviceString = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
    
    return deviceString;
    
}

- (NSString *)systemVersion {
    return [[UIDevice currentDevice] systemVersion];
}

- (NSString *)region {
    return NSLocale.preferredLanguages.firstObject;
}

- (NSString *)deviceName {
    return [UIDevice currentDevice].name;
}

- (NSString *)appVersion {
    return [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"];
}



@end
